<template>
  <nav>
    <a href="">提问</a>
    <input type="text" placeholder="搜索问答" @focus="sousuo" />
    <img src="../../../assets/铃铛.png" alt="" @click="xx" />
    <ul>
      <router-link tag="li" :to="{ name: 'essence' }" active-class="active">
        <span>精华问答</span>
      </router-link>
      <router-link tag="li" :to="{ name: 'newest' }" active-class="active">
        <span>最新问题</span>
      </router-link>
      <router-link tag="li" :to="{ name: 'hottest' }" active-class="active">
        <span>最热问题</span>
      </router-link>
    </ul>
  </nav>
</template>

<script>
// import WendaTopNav from '@/components/WendaTopNa
export default {
  data() {
    return {
      src: 'https://api.hongbeibang.com/question/getHot?_t=1607152689639&pageIndex=0&pageSize=10&all=true&timestamp=1607152689638'
    }
  },
  methods: {
    sousuo() {
      this.$router.push({ path: '/search' })
    },
    xx() {
      this.$router.push({ path: '/xiaoxi' })
    }
  },
  mounted() {}
}
</script>
<style lang="scss" scoped>
nav {
  width: 100%;
  height: 100px;
  line-height: 50px;
  border-bottom: 1px solid #ccc;
  background-color: #fff;

  z-index: 999;
  position: fixed;
  top: 0;
  z-index: 10;
  background-color: #ffffff;
  a {
    color: orange;
    font-size: 18px;
  }
  input {
    width: 70%;
    height: 35px;
    margin-left: 15px;
    border-radius: 4px;
    background-color: #f5f7f9;
    line-height: 50px;
    border: none;
  }

  img {
    width: 25px;
    height: 25px;
    float: right;
    margin-right: 25px;
    margin-top: 15px;
  }
  ul {
    display: flex;
    text-align: center;
    li {
      flex: 1;
      display: flex;
      justify-content: center;
      &.active {
        span {
          width: 80%;
          border-bottom: 2px solid red;
          display: block;
          color: #fe5100;
        }
      }
    }
  }
}
</style>
